From 96b84001d58fa3c9ed8bbcfe1f9d3ae097373508 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 5 Mar 2010 14:31:14 +0000 Subject: [PATCH] vt-d: ensure x2apic is not enabled accidently if no DRHD at all. Thanks to Jan Beulich for pointing this out. Signed-off-by: Dexuan Cui --- xen/drivers/passthrough/vtd/intremap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c index 87c639d501..9459a81736 100644 --- a/xen/drivers/passthrough/vtd/intremap.c +++ b/xen/drivers/passthrough/vtd/intremap.c @@ -131,6 +131,9 @@ int iommu_supports_eim(void) if ( !iommu_enabled || !iommu_qinval || !iommu_intremap ) return 0; + if ( list_empty(&acpi_drhd_units) ) + return 0; + for_each_drhd_unit ( drhd ) if ( !ecap_queued_inval(drhd->ecap) || !ecap_intr_remap(drhd->ecap) || -- 2.30.2